package cn.itcast.result;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result implements Serializable {
    private boolean flag;
    private Integer code;
    private Object data;
    private String message;

    public static Result error(String message){
        return new Result(false, CodeConstant.ERROR,null,message);
    }

    public static Result error(Integer code,String message){
        return new Result(false, code,null,message);
    }
}
